package client;

import client.netty.NettyClient;
import pojo.Blog;
import pojo.User;
import service.BlogService;
import service.UserService;

public class ClientTest {
    public static void main(String[] args) {
//        RPCClient rpcClient = new SimpleClient();
        RPCClient rpcClient = new NettyClient();
        ClientProxy proxy = new ClientProxy(rpcClient);
        UserService userService = proxy.getProxy(UserService.class);
        BlogService blogService = proxy.getProxy(BlogService.class);

        User user = userService.getUserById(1);
        System.out.println(user);
        Integer id = userService.insertUser(new User(2, "fch", "female"));
        System.out.println(id);

        Blog blog = blogService.getBlogById(1);
        System.out.println(blog);

    }
}
